import { createApp } from 'vue'
import router from './router/index'
import { store, key } from "./store/index";
import ElementPlus from 'element-plus'
import "element-plus/dist/index.css";
import * as Icons from "@element-plus/icons";
import App from "./App.vue";
const app = createApp(App);
app.use(store, key).use(router).use(ElementPlus).mount("#app");

const person = {
  name: "张三",
  age: 18
}
//keyof获取某种类型的 所有键（key）,返回的类型是一个联合类型
// const Icon = (props: { icon: string }) => {
//   const { icon } = props;
//   return createVNode(Icons[icon as keyof typeof Icons]);
// };
// Object.keys(Icons).forEach((key) => {
//   app.component("key", Icons[key]);
// })
Object.keys(Icons).forEach((key) => {
  app.component("key", Icons[key as keyof typeof Icons]);
})
//app.component("Icons", icons);